using FluentScheduler;
using Publicuse.Entity;
using Publicuse.Interface;
using Publicuse.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Publicuse.Cache
{
    public class RegistryCache : Registry
    {
        public RegistryCache(IMySqlSugarService mySqlSugar)
        {
            //测试同步信息到Redis
            Schedule(new FluentSchedulerTest(mySqlSugar).Execute).ToRunNow().AndEvery(10).Seconds();
        }
    }

    public class FluentSchedulerTest : IJob
    { 

        private  IMySqlSugarService mySqlSugar;

        public FluentSchedulerTest(IMySqlSugarService mySqlSugar)
        {
            this.mySqlSugar = mySqlSugar;
        }
        public void Execute()
        {
            var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            var result = "现在时间是：" + time;
        }
    }
}
